home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 2004 #11
/
Amiga Plus CD - 2004 - No. 11.iso
/
AmiSoft
/
Biz
/
swood
/
FW_Scripts.lha
/
FW_Scripts
/
Convert2PDF.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
2004-08-15
|
2KB
|
59 lines
/*
FinalWriter AREXX macro
Convert to PDF uses GHOSTSCRIPT ® to convert
the current document to PDF format.
$VER: Convert to PDF 1.4 (15.08.04)
Original script by elal@dds.nl
Download the original from Aminet for documentation.
Archive is util/rexx/Convert_to_PDF.lha
Modified to work with A.F.P.L. Ghostscript 8.13
located at http://www.whoosh777.pwp.blueyonder.co.uk/
Make sure your path is "GS813:bin/gs" or edit
the path below to match your setup.
*/
Options Results
GetPageSetup PageType
PageSize = result
PSPrintPrefs PageType PageSize
IF PageSize = 'Custom' THEN DO
SetMeasure Micropoints
GetPageSetup WIDTH HEIGHT
Parse Var RESULT w h
PSPrintPrefs CustomWidth w
PSPrintPrefs CustomHeight h
w = w / 10
h = h / 10
SetMeasure Ruler
END
IF PageSize = 'USLetter' THEN PageSize = 'letter'
IF PageSize = 'USLegal' THEN PageSize = 'legal'
IF PageSize = 'A3' THEN PageSize = 'a3'
IF PageSize = 'A4' THEN PageSize = 'a4'
IF PageSize = 'A5' THEN PageSize = 'a5'
IF PageSize = 'B5' THEN PageSize = 'b5'
PostscriptFile 'T:OK.ps'
PrintSetup PRINTTO psfile
PSPrintPrefs SHADE color
Print
ADDRESS COMMAND
'Wait'
'Delete' 'T:OK.ps.info'
'RequestFile' '>ENV:File' 'Title="Where to save the PDF file?"' 'Pubscreen="FinalWriterPubScreen"'
IF rc ~= 0 THEN EXIT
'echo >T:Tmp' '"Stack 150000"'
IF PageSize = 'Custom' THEN 'echo >>T:Tmp' '"GS813:bin/gs -sDEVICE=pdfwrite -dPDFSETTINGS=/printer -dDEVICEWIDTHPOINTS='||w||' -dDEVICEHEIGHTPOINTS='||h||' -dBATCH -dNOPAUSE -sOutputFile=T:KO.pdf T:OK.ps"'
ELSE 'echo >>T:Tmp' '"GS813:bin/gs -sDEVICE=pdfwrite -dPDFSETTINGS=/printer -sPAPERSIZE='||PageSize||' -dBATCH -dNOPAUSE -sOutputFile=T:KO.pdf T:OK.ps"'
'Execute' 'T:Tmp'
'Delete' 'T:OK.ps'
'Copy' 'T:KO.PDF' '$file'
'Delete' 'T:KO.pdf'
'Delete' 'T:Tmp'